package com.dingup.paike.bean.aobean;

import com.alibaba.fastjson.annotation.JSONField;

import java.math.BigDecimal;

/**
 * Created by wancheng on 2018/10/25.
 */
public class SubjectMessageAO {

    private String subjectName;
    private String teacherName;
    private BigDecimal classHour;


    public SubjectMessageAO() {
    }

    public SubjectMessageAO(String subjectName, String teacherName) {
        this.subjectName = subjectName;
        this.teacherName = teacherName;
    }

    public SubjectMessageAO(String subjectName, String teacherName, BigDecimal classHour) {
        this.subjectName = subjectName;
        this.teacherName = teacherName;
        this.classHour = classHour;
    }

    @JSONField(serialize = false)
    public SubjectMessageAO getGroupingBy() {
        return new SubjectMessageAO(this.subjectName, this.teacherName);
    }

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public String getTeacherName() {
        return teacherName;
    }

    public void setTeacherName(String teacherName) {
        this.teacherName = teacherName;
    }

    public BigDecimal getClassHour() {
        return classHour;
    }

    public void setClassHour(BigDecimal classHour) {
        this.classHour = classHour;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        SubjectMessageAO that = (SubjectMessageAO) o;

        if (!subjectName.equals(that.subjectName)) {
            return false;
        }
        if (!teacherName.equals(that.teacherName)) {
            return false;
        }
        return classHour != null ? classHour.equals(that.classHour) : that.classHour == null;

    }

    @Override
    public int hashCode() {
        int result = subjectName.hashCode();
        result = 31 * result + teacherName.hashCode();
        result = 31 * result + (classHour != null ? classHour.hashCode() : 0);
        return result;
    }
}
